<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('用户列表')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <style>
        .select-list li input {
            width: 100px;
        }

        .box-main > .box-header {
            display: none;
        } 

		.search-collapse {
		    z-index:5;
		    position: fixed;
		    width: 73%;
		}

        .fixed-table-toolbar {
            display: none;
        }

		 .select-table{
		  padding-top: 80px;
		}
    </style>
</head>
<body class="gray-bg">
<!-- <div class="ui-layout-west">
    <div class="main-content">
        <div class="box box-main">
            <div class="box-header">
                <div class="box-title">
                    <i class="fa icon-grid"></i> 组织机构
                </div>
                <div class="box-tools pull-right">
                    <a type="button" class="btn btn-box-tool menuItem" href="#" onclick="dept()" title="管理部门"><i
                            class="fa fa-edit"></i></a>
                    <button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i
                            class="fa fa-chevron-up"></i></button>
                    <button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i
                            class="fa fa-chevron-down"></i></button>
                    <button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新部门"><i
                            class="fa fa-refresh"></i></button>
                </div>
            </div>
            <div class="ui-layout-content">
                <div id="tree" class="ztree"></div>
            </div>
        </div>
    </div>
</div> -->

<div class="ui-layout-center">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="user-form">
                    <input type="hidden" id="deptId" name="deptId">
                    <input type="hidden" id="parentId" name="parentId">
                    <input type="hidden" id="status" name="status" value="0">
                    <div class="select-list">
                        <ul>
                            <li>
                               员工姓名：<input type="text" name="userName"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                        class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                        class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>


            <div class="col-sm-12 select-table table-striped pop-table">
                <table id="bootstrap-table" data-mobile-responsive="true"></table>
            </div>
        </div>
    </div>
</div>

<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:user:edit')}]];
    var prefix = ctx + "system/user";

    $(function () {
    	 
        var panehHidden = false;
        if ($(this).width() < 769) {
            panehHidden = true;
        }
        $('body').layout({initClosed: panehHidden, west__size: 185});
        queryUserList();


    });

    function queryUserList() {
        var options = {
            url: prefix + "/list",
            uniqueId: "userId",
            sortOrder: "desc",
            modalName: "用户",
            pageSize: 10,
            striped: true,
            clickToSelect: true, //是否启用点击选中行
            maintainSelected: true,
            onClickRow: onClickRow,
            columns: [{
                // field: 'userId',
                radio: true
            },
                {
                    field: 'userId',
                    title: '用户ID',
                    visible: false
                },
                {
                    field: 'userName',
                    title: '用户名称'
                },
                {
                    field: 'dept.deptName',
                    title: '部门'
                },
                {
                    field: 'phonenumber',
                    title: '手机'
                }]
        };
        $.table.init(options);
    }
    
    var choserUserId = '';
    var choserUserName = '';
    
    function onClickRow(row, $element) {
    	 setTimeout(function () {
    		 choserUserId = row.userId;
	    	 choserUserName = row.userName;
    	 }, 300);

    }
    function submitHandler(index, layero) {
   	   parent.$('#userName').val(choserUserName);
   	   parent.$('#userId').val(choserUserId);
   	   $.modal.close();
    }


</script>
</body>
</html>